<template>
    <div class="box">
        <van-nav-bar title="确认订单" />
        <van-address-list v-model="chosenAddressId" :list="list" default-tag-text="默认" @edit="onEdit" />
        <van-submit-bar :price="3050" button-text="提交订单" @submit="onSubmit" />
        <van-cell-group>
            <van-cell title="商品金额" value="￥32.33" />
            <van-cell title="运费" value="￥3.00" />
            <van-cell title="立减" value="-￥20" />
            <van-cell title="优惠券" value="无可用" />
        </van-cell-group>
    </div>
</template>

<script setup>

import { ref } from 'vue';
import { showToast } from 'vant';

const chosenAddressId = ref('1');
const list = [
    {
        id: '1',
        name: '张三',
        tel: '13000000000',
        address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
        isDefault: true,
    },
]

// const onAdd = () => showToast('新增地址');
const onEdit = (item, index) => showToast('编辑地址:' + index);
const onSubmit = () => showToast('点击按钮')


</script>

<style lang="scss" scoped>

</style>